package org.hegang.design.first.bridgepattern.demo;

/**
 * @ClassName Computer
 * @Describe:
 * @Author: gang.he
 * @Date: Created in 15:31 2021/4/22
 * @Modified:
 * @Version: V1.0
 */
public abstract class Computer {

    protected Brand brand;

    public Computer(Brand brand){
        this.brand = brand;
    }

    public abstract void info();
}

class Desktop extends Computer{

    public Desktop(Brand brand) {
        super(brand);
    }

    @Override
    public void info() {
        this.brand.info();
        System.out.print("台式电脑");
        System.out.println();
    }
}

class Notebook extends Computer {

    public Notebook(Brand brand) {
        super(brand);
    }

    @Override
    public void info() {
        this.brand.info();
        System.out.print("笔记本电脑");
        System.out.println();
    }
}
